package cfg

import (
	"flag"
	"toolkit/cfg/nacos"
	configor "toolkit/config"
)

var confPath string

func init() {
	flag.StringVar(&confPath, "f", "", "path of config file")
}

func Load(v interface{}) error {
	if confPath == "" { //load from nacos
		nacos.New().Load(v)
	} else { //from local file
		return configor.Load(v, confPath)
	}
	return nil
}
